import sys

def main():
    if len(sys.argv) != 2:
        print("Usage: python result.py <result_file>")
        sys.exit(1)
    fname = sys.argv[1]
    with open(fname, "r") as f:
        for (i, line) in enumerate(f):
            if i == 0:
                print(line.strip(), "time2,sys,user,cpu,mem", sep=",")
            else:
                if i % 2 == 1:
                    print(line.strip(), end=",")
                else:
                    print(line.strip())


if __name__ == "__main__":
    main()